﻿@model IEnumerable<Scap.Info.ScapEmployee>

<div id="@ViewBag.MainDiv">
    <div class="sfactive">Empleados -> Definir Empleado</div>
    <div style="width: 100%; border: 1px solid #808080; margin-top: 5px; margin-bottom: 5px; padding: 5px;">

        @using (Html.BeginForm("Index", "tabsEmpleado", null, FormMethod.Post, new { id = "formsearchEmpleadoid" }))
        {
            <div class="tblvios02">
                <table style="width: 900px;">
                    <tr>
                        <td class="editor-label">Identificación</td>
                        <td class="vios160_0">
                            <input id="identificacionid" name="identificacionid" type="text" value="@ViewBag.IdentificacionId" /></td>
                        <td class="editor-label">Nombre</td>
                        <td class="vios160_0">
                            <input id="nombreid" name="nombreid" type="text" value="@ViewBag.Nombreid" /></td>
                        <td class="editor-label">Tarjeta Numero</td>
                        <td class="vios160_0">
                            <input id="tarjetaNoid" name="tarjetaNoid" type="text" /></td>
                    </tr>
                    <tr>
                        <td class="editor-label">Celular</td>
                        <td class="vios160_0">
                            <input id="celularid" name="celularid" type="text" value="@ViewBag.Celularid" />
                        </td>
                        <td class="editor-field">Departamento</td>
                        <td class="vios160_0">
                            <input id="departamentosearchid" name="departamentosearchid" type="text" /></td>
                        <td class="editor-label">Numero de seguro social</td>
                        <td class="vios160_0">
                            <input id="nsssearchid" name="nsssearchid" type="text" value="@ViewBag.Nsssearchid" /></td>
                    </tr>
                    <tr>
                        <td colspan="4" style="text-align: right;">
                            <div style="display: block">
                                <input id="SubmitEmpleadoSearch1" type="submit" value="Buscar" />
                            </div>
                        </td>
                        <td style="text-align: center;">@Html.ActionLink("Avanzada", "Index", "Employee", null, null)</td>
                        <td>@Html.ActionLink("Ver Todo", "Index", "Employee", null, null)</td>
                    </tr>
                </table>
            </div>   
        }
    </div>
    <div style="width: 100%; border: 1px solid #808080; margin-top: 5px; margin-bottom: 5px; padding: 5px;">
        <table class="webgrid">
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.Identification)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.FullName)
                </th>
                @*<th>
                    @Html.DisplayNameFor(model => model.FirstName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.LastName)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Genre)
                </th>*@
                <th>
                    @Html.DisplayNameFor(model => model.SocialSecurityNumber)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Birthday)
                </th>
                @*<th>
                    @Html.DisplayNameFor(model => model.OriginCity.Name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.ResidenceCity.Name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.HomeAddress)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BusinessAddress)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.PostalCode)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.HomePhone)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.BusinessPhone)
                </th>*@
                <th>
                    @Html.DisplayNameFor(model => model.CellPhone)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.Email)
                </th>
                @*<th>
                    @Html.DisplayNameFor(model => model.Image)
                </th>*@
                <th></th>
            </tr>
            @{
                int nRow = 0;
                int nMod = 0;
                string szClass = "";
            }

            @foreach (var item in Model)
            {
                nRow++;
                nMod = (nRow % 2);
                if (nMod == 0)
                {
                    szClass = "webgrid-alternating-row";
                }
                else
                {
                    szClass = "webgrid-row-style";
                }

                <tr class="@szClass">
                    <td>
                        @Html.DisplayFor(modelItem => item.Identification)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.FullName)
                    </td>
                    @* <td>
                        @Html.DisplayFor(modelItem => item.FirstName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.LastName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Genre)
                    </td>*@
                    <td>
                        @Html.DisplayFor(modelItem => item.SocialSecurityNumber)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Birthday)
                    </td>
                    @*<td>
                        @Html.DisplayFor(modelItem => item.OriginCity.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.ResidenceCity.Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.HomeAddress)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BusinessAddress)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.PostalCode)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.HomePhone)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.BusinessPhone)
                    </td>*@
                    <td>
                        @Html.DisplayFor(modelItem => item.CellPhone)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Email)
                    </td>
                    @*<td>
                        @Html.DisplayFor(modelItem => item.Image)
                    </td>*@
                    <td>
                        <div class="editarempleadoaction">
                            @Html.ActionLink("Editar", "AddEmployee", new { id = item.Id }, null) |
                        </div>
                        @Html.ActionLink("Borrar", "DeleteEmployee", "Employee", new { id = item.Id }, new { onclick = "return confirm('Desea borrar este empleado?');" })
                    </td>
                </tr>
            }
            <tr>
                <td colspan="7">
                    <table border="0" cellpadding="0" cellspacing="0" style="width: 95%">
                        <tr>
                            <td>
                                @{
                                    string szStyleHasPreviousPage = "display:none";
                                    string szStyleHasNextPage = "display:none";
                                    if (ViewBag.HasPreviousPage)
                                    {
                                        szStyleHasPreviousPage = "display:block";
                                    }
                                    if (ViewBag.HasNextPage)
                                    {
                                        szStyleHasNextPage = "display:block";
                                    }
                                }
                                <div style="border: 0px solid #CCCC00;">
                                    <table class="tblvios" style="width: 60%">
                                        <tr>
                                            <td>Page @(ViewBag.PageCount < ViewBag.PageNumber ? 0 : ViewBag.PageNumber)
                                                of @ViewBag.PageCount</td>
                                            <td>
                                                <div style="@szStyleHasNextPage">
                                                    @using (Html.BeginForm("Index", "tabsEmpleado", new { page = ViewBag.PageNumber + 1, sortOrder = ViewBag.CurrentSort }, FormMethod.Post, new { @class = "employeeNavLnk" }))
                                                    {
                                                        <input class="btEmpleadoNav" id="nextSubmit1tbsEmpid" type="submit" value="Next" />
                                                    }
                                                </div>
                                            </td>
                                            <td>
                                                <div style="@szStyleHasNextPage">
                                                    @using (Html.BeginForm("Index", "tabsEmpleado", new { page = ViewBag.PageCount, sortOrder = ViewBag.CurrentSort }, FormMethod.Post, new { @class = "employeeNavLnk" }))
                                                    {
                                                        <input class="btEmpleadoNav" id="LastSubmit1tbsEmpid" type="submit" value="Last" />
                                                    }
                                                </div>
                                            </td>
                                            <td>
                                                <div style="@szStyleHasPreviousPage">
                                                    @using (Html.BeginForm("Index", "tabsEmpleado", new { page = 1, sortOrder = ViewBag.CurrentSort }, FormMethod.Post, new { @class = "employeeNavLnk" }))
                                                    {
                                                        <input class="btEmpleadoNav" id="FirstSubmit1tbsEmpid" type="submit" value="First" /> 
                                                    }
                                                </div>
                                            </td>
                                            <td>
                                                <div style="@szStyleHasPreviousPage">
                                                    @using (Html.BeginForm("Index", "tabsEmpleado", new { page = ViewBag.PageNumber - 1, sortOrder = ViewBag.CurrentSort }, FormMethod.Post, new { @class = "employeeNavLnk" }))
                                                    {
                                                        <input class="btEmpleadoNav" id="PrevSubmit1tbsEmpid" type="submit" value="Prev" /> 
                                                    }
                                                </div>
                                            </td>
                                        </tr>
                                    </table>

                                </div>
                            </td>
                            <td style="display: none">
                                @Html.ActionLink("Back", "Index")
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>

    </div>
</div>
